package org.example.onlinechat.service;

import org.example.onlinechat.entity.User;
import org.example.onlinechat.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public List<User> findByUsername(String username) {
        return userMapper.findByUsername(username);
    }

    public void register(User user) {
        userMapper.register(user);
    }

    public List<User>  findFromUsername(String name) {
        return userMapper.findFromUsername(name);
    }
}
